Polygon2
data class Polygon2(val vertices: List<Vec2>, val precision: DoubleEquivalence = DEFAULT_DOUBLE_EQUIVALENCE) : Polygon<Vec2> (source)
Represents a polygon in 2D space defined by a list of vertices.
The polygon is defined by its vertices in order (either clockwise or counterclockwise). The last vertex is implicitly connected to the first vertex to close the polygon.
Properties
Link copied to clipboard
The precision used for geometric computations, defaulting to DEFAULT_DOUBLE_EQUIVALENCE.
Link copied to clipboard
Returns the number of vertices in the polygon.
Functions
Link copied to clipboard
Computes the axis-aligned bounding box of the polygon.
Link copied to clipboard
Returns the number of dimensions of the spatial object.
Link copied to clipboard
Returns true if any value in the spatial is infinite.
Link copied to clipboard
Determines the orientation of the polygon based on the sign of its area.
Link copied to clipboard
Computes the signed area of the polygon.
Link copied to clipboard
Transforms the polygon by applying a transformation to all vertices.